<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="Linux学习总结, blog">
    <meta name="description" content="这是我的个人网站，欢迎来访">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <!-- Global site tag (gtag.js) - Google Analytics -->


    <title>Linux学习总结 | 头号咸鱼</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery.min.js"></script>

    <script>(function(i,s,o,g,r,a,m){i["DaoVoiceObject"]=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;a.charset="utf-8";m.parentNode.insertBefore(a,m)})(window,document,"script",('https:' == document.location.protocol ? 'https:' : 'http:') + "//widget.daovoice.io/widget/7b318e23.js","daovoice")</script>
    

<meta name="generator" content="Hexo 5.3.0">
<style>.github-emoji { position: relative; display: inline-block; width: 1.2em; min-height: 1.2em; overflow: hidden; vertical-align: top; color: transparent; }  .github-emoji > span { position: relative; z-index: 10; }  .github-emoji img, .github-emoji .fancybox { margin: 0 !important; padding: 0 !important; border: none !important; outline: none !important; text-decoration: none !important; user-select: none !important; cursor: auto !important; }  .github-emoji img { height: 1.2em !important; width: 1.2em !important; position: absolute !important; left: 50% !important; top: 50% !important; transform: translate(-50%, -50%) !important; user-select: none !important; cursor: auto !important; } .github-emoji-fallback { color: inherit; } .github-emoji-fallback img { opacity: 0 !important; }</style>
<link rel="alternate" href="/atom.xml" title="头号咸鱼" type="application/atom+xml">
</head>




<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">头号咸鱼</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>


<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">头号咸鱼</div>
        <div class="logo-desc">
            
            这是我的个人网站，欢迎来访
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/blinkfox/hexo-theme-matery" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>


        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/blinkfox/hexo-theme-matery" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    



<div class="bg-cover pd-header post-cover" style="background-image: url('https://cdn.jsdelivr.net/gh/liangxinxin5102/image2/cartoon01/wallhaven-k9zl2q.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">Linux学习总结</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        padding: 35px 0 15px 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        padding-bottom: 30px;
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;

        position: absolute;
        right: 23.5vw;
        display: block;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/tags/%E6%80%BB%E7%BB%93/">
                                <span class="chip bg-color">总结</span>
                            </a>
                        
                            <a href="/tags/ubuntu/">
                                <span class="chip bg-color">ubuntu</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/categories/Linux/" class="post-category">
                                Linux
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2021-03-15
                </div>
                

                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-check fa-fw"></i>更新日期:&nbsp;&nbsp;
                    2021-03-16
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    5.1k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    19 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>
        </div>
        <hr class="clearfix">

        
        <!-- 是否加载使用自带的 prismjs. -->
        <link rel="stylesheet" href="/libs/prism/prism.css">
        

        

        <div class="card-content article-card-content">
            <div id="articleContent">
                <blockquote>
<p>这篇博客写得不完美，也不想去花时间去写得完美了。准备把shell相关的写完整，把gcc，gdb和makefile也写进去，但是用不上，也不知道从处整理。自己还了解到内核和驱动，那是不知道怎么学。还有图形化界面组件的使用等。自己再写这篇博客的时候把自己收藏的linux几本书都看了，感觉也没什么的，也不知道怎么写才完美。最后，自己的时间不多了。</p>
</blockquote>
<h2 id="一、文件系统"><a href="#一、文件系统" class="headerlink" title="一、文件系统"></a>一、文件系统</h2><h4 id="1-目录含义"><a href="#1-目录含义" class="headerlink" title="1.目录含义"></a>1.目录含义</h4><table>
<thead>
<tr>
<th>目录</th>
<th>描述</th>
</tr>
</thead>
<tbody><tr>
<td>/(根目录)</td>
<td>文件系统的最顶层</td>
</tr>
<tr>
<td>/root</td>
<td>root用户的主目录</td>
</tr>
<tr>
<td>/etc</td>
<td>系统和应用程序的配置文件</td>
</tr>
<tr>
<td>/proc</td>
<td>虚拟文件系统，文件都是虚拟的，大部分只读。内核通过该目录向用户空间提供系统资源的访问能力，包括系统的状态和正在运行的所有进程。两个重要文件CUP配置文件（/proc/cupiofo)和内存使用状态文件(/proc/meminfo)</td>
</tr>
<tr>
<td>/var</td>
<td>存放系统和应用程序创建的运行文件。日志文件（/var/log），文件锁（/var/run）</td>
</tr>
<tr>
<td>/boot</td>
<td>存放系统的启动文件。包括启动器（bootloader）和Linux内核</td>
</tr>
<tr>
<td>/bin和/sbin</td>
<td>存放程序文件，命令行输入命名，系统在指定路径查找应用程序，这些路径（默认包括/bin和/sbin）组成了PATH环境变量。普通用户一般只有/bin目录</td>
</tr>
<tr>
<td>/dev</td>
<td>存放设备的映射文件，为系统访问硬件提供方便</td>
</tr>
<tr>
<td>/home</td>
<td>所有用户的主目录</td>
</tr>
<tr>
<td>/lib</td>
<td>存放应用程序使用的库文件</td>
</tr>
<tr>
<td>/lost+found</td>
<td>文件系统无法记录某个文件时，会放到这个文件中</td>
</tr>
<tr>
<td>/mnt</td>
<td>文件系统的挂在。比如硬盘</td>
</tr>
<tr>
<td>/media</td>
<td>为了明确区分移动媒体（U盘）和挂载设备（改在在/mnt）。目录中的内容由Linux自动挂载系统操作</td>
</tr>
<tr>
<td>/usr</td>
<td>存放计安装的几乎所有软件</td>
</tr>
<tr>
<td>/opt</td>
<td>没明确用途，第三放应用会使用，比如Oracle数据库服务</td>
</tr>
<tr>
<td>/srv</td>
<td>存放系统服务的运行文件（不在/var中可能就在这）</td>
</tr>
<tr>
<td>/sys</td>
<td>存放系统信息，真实存在</td>
</tr>
<tr>
<td>/tmp</td>
<td>存放应用创建的临时文件，重启后会清空</td>
</tr>
</tbody></table>
<h4 id="2-文件类型"><a href="#2-文件类型" class="headerlink" title="2.文件类型"></a>2.文件类型</h4><table>
<thead>
<tr>
<th>类型</th>
<th>特点</th>
</tr>
</thead>
<tbody><tr>
<td>普通文件</td>
<td>白色，一般性文件</td>
</tr>
<tr>
<td>目录</td>
<td>蓝色，文件名最后加<code>/</code></td>
</tr>
<tr>
<td>可执行文件</td>
<td>绿色，文件名最后加<code>*</code></td>
</tr>
<tr>
<td>压缩文件</td>
<td>红色</td>
</tr>
<tr>
<td>链接文件</td>
<td>青色</td>
</tr>
<tr>
<td>设备文件</td>
<td>黄色，通常位于/dev下</td>
</tr>
</tbody></table>
<h2 id="二、命令"><a href="#二、命令" class="headerlink" title="二、命令"></a>二、命令</h2><h4 id="1-一些概念"><a href="#1-一些概念" class="headerlink" title="1.一些概念"></a>1.一些概念</h4><h6 id="绝对路径和相对路径"><a href="#绝对路径和相对路径" class="headerlink" title="绝对路径和相对路径"></a>绝对路径和相对路径</h6><ul>
<li>绝对路径：从根目录开始。例如/home/lxx</li>
<li>相对路径：从特定文件、目录或者<code>.</code>和<code>..</code>开始。例如.././lxx或者lxx/app</li>
</ul>
<h6 id="目录特殊表示"><a href="#目录特殊表示" class="headerlink" title="目录特殊表示"></a>目录特殊表示</h6><table>
<thead>
<tr>
<th>符号</th>
<th>含义</th>
</tr>
</thead>
<tbody><tr>
<td>.</td>
<td>当前目录</td>
</tr>
<tr>
<td>..</td>
<td>上一层目录</td>
</tr>
<tr>
<td>-</td>
<td>前一个工作目录</td>
</tr>
<tr>
<td>~</td>
<td>当前使用者身份所在的家目录</td>
</tr>
<tr>
<td>~account</td>
<td>account使用者的家目录</td>
</tr>
</tbody></table>
<h6 id="文件权限"><a href="#文件权限" class="headerlink" title="文件权限"></a>文件权限</h6><ul>
<li>文件三种权限：<strong>读r、写w、执行x</strong></li>
<li>访问文件的三种角色</li>
</ul>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>户User</td>
<td>文件的所有者</td>
</tr>
<tr>
<td>用户组Group</td>
<td>文件的所有者所在的组</td>
</tr>
<tr>
<td>其他World</td>
<td>文件所有者位其他人</td>
</tr>
</tbody></table>
<h6 id="软连接与硬链接"><a href="#软连接与硬链接" class="headerlink" title="软连接与硬链接"></a>软连接与硬链接</h6><ul>
<li>软连接：与win的快捷方式类似，表明文件真是地址的指向。ln -s 创建</li>
<li>硬链接：给一个文件创建两个名字，不建议使用。ln 不带参数</li>
</ul>
<h4 id="2-文件与目录操作"><a href="#2-文件与目录操作" class="headerlink" title="2.文件与目录操作"></a>2.文件与目录操作</h4><h6 id="ls命令：显示目录内容"><a href="#ls命令：显示目录内容" class="headerlink" title="ls命令：显示目录内容"></a>ls命令：显示目录内容</h6><table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>-a</td>
<td>显示隐藏文件</td>
</tr>
<tr>
<td>-l</td>
<td>显示详细信息，如权限，大小，时间</td>
</tr>
<tr>
<td>-F</td>
<td>输出文件加上文件标识符，如文件夹/，可执行文件*</td>
</tr>
<tr>
<td>-lt</td>
<td>按照时间顺序显示</td>
</tr>
<tr>
<td>-lh</td>
<td>显示文件大小，KB，MB</td>
</tr>
</tbody></table>
<h6 id="cd命令：切换目录"><a href="#cd命令：切换目录" class="headerlink" title="cd命令：切换目录"></a>cd命令：切换目录</h6><table>
<thead>
<tr>
<th>cd /home</th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>cd ..</td>
<td>进入上一级目录</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</tbody></table>
<h6 id="cp命令：赋值文件"><a href="#cp命令：赋值文件" class="headerlink" title="cp命令：赋值文件"></a>cp命令：赋值文件</h6><table>
<thead>
<tr>
<th>cp   源文件    目的文件</th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>-v</td>
<td>显示详细信息</td>
</tr>
<tr>
<td>cp 源文件 文件夹</td>
<td>赋值文件到指定目录</td>
</tr>
<tr>
<td>-f</td>
<td>强制覆盖</td>
</tr>
<tr>
<td>cp -v flie[1-3]  ./test</td>
<td>还可以使用<strong>通配符</strong></td>
</tr>
<tr>
<td>cp -vR ./test/ ./testShell/</td>
<td>将一个目录赋值到指定目录下</td>
</tr>
<tr>
<td>-i</td>
<td>提示是否覆盖</td>
</tr>
<tr>
<td>-r</td>
<td>赋值子目录</td>
</tr>
</tbody></table>
<h6 id="mv命令：移动文件或改名"><a href="#mv命令：移动文件或改名" class="headerlink" title="mv命令：移动文件或改名"></a>mv命令：移动文件或改名</h6><table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>-b</td>
<td>目标文件存在的时候，会备份一下</td>
</tr>
<tr>
<td>mv newfile[a-d] newdirectory/</td>
<td>使用通配符</td>
</tr>
</tbody></table>
<h6 id="pwd命令：打印当前工作目录"><a href="#pwd命令：打印当前工作目录" class="headerlink" title="pwd命令：打印当前工作目录"></a>pwd命令：打印当前工作目录</h6><h6 id="rm命令：删除文件或目录"><a href="#rm命令：删除文件或目录" class="headerlink" title="rm命令：删除文件或目录"></a>rm命令：删除文件或目录</h6><ul>
<li>rm -rf：强制递归删除</li>
</ul>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>-f</td>
<td>强制删除</td>
</tr>
<tr>
<td>-i</td>
<td>提示yes或者no</td>
</tr>
<tr>
<td>-r</td>
<td>递归方法删除目录以及目录下的所有内容</td>
</tr>
<tr>
<td>-v</td>
<td>详细过程</td>
</tr>
</tbody></table>
<h6 id="mkdir命令：创建目录"><a href="#mkdir命令：创建目录" class="headerlink" title="mkdir命令：创建目录"></a>mkdir命令：创建目录</h6><ul>
<li><p>-p    创建指定目录中缺少的中间目录</p>
</li>
<li><p>mkdir   -p    /dir1/dir2/dir3</p>
</li>
</ul>
<h6 id="ln命令：为文件创建链接"><a href="#ln命令：为文件创建链接" class="headerlink" title="ln命令：为文件创建链接"></a>ln命令：为文件创建链接</h6><ul>
<li>默认生成硬链接（不常用</li>
<li>-s     参数生成软链接</li>
<li>ln     源文件     目标文件</li>
</ul>
<h6 id="chmod命令：改变文件的访问权限"><a href="#chmod命令：改变文件的访问权限" class="headerlink" title="chmod命令：改变文件的访问权限"></a>chmod命令：改变文件的访问权限</h6><ul>
<li>-R     递归操作，文件夹下的所有文件或目录的权限也改变</li>
</ul>
<table>
<thead>
<tr>
<th>用户角色</th>
<th></th>
<th>操作种类</th>
<th></th>
<th>操作对象</th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>u</td>
<td>文件所有者</td>
<td>+</td>
<td>添加权限</td>
<td>r</td>
<td>读写权限</td>
</tr>
<tr>
<td>g</td>
<td>文件所属用户组</td>
<td>-</td>
<td>删除权限</td>
<td>w</td>
<td>写入权限</td>
</tr>
<tr>
<td>o</td>
<td>其他用户</td>
<td>=</td>
<td>指定权限</td>
<td>x</td>
<td>执行权限</td>
</tr>
<tr>
<td>a</td>
<td>所有用户</td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tbody></table>
<ul>
<li>指定权限后，所有未指定的权限就会被删除</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">chmod a= pi<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>为自己打开所有权限</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">chmod u+rwx pi<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>文件所属组和其他用户添加读权限</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">chmod go+r pi<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>还可以用数字来代替</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">chmod 744 pi<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<blockquote>
<ul>
<li>三个数字代表三个角色（知道前面的相关知识很重要）</li>
<li>读取权限：4</li>
<li>写入权限：2</li>
<li>执行权限：1</li>
</ul>
</blockquote>
<h6 id="chown命令：改变文件的所有者"><a href="#chown命令：改变文件的所有者" class="headerlink" title="chown命令：改变文件的所有者"></a>chown命令：改变文件的所有者</h6><ul>
<li>将文件所有权转给root用户</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">chown root pi<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>查看转让情况</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">sudo chgrp root pi<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<blockquote>
<p>装让目录的权限，下面的文件权限不会被转让，需要添加参数-R</p>
</blockquote>
<h6 id="touch命令：设置文件的时间属性"><a href="#touch命令：设置文件的时间属性" class="headerlink" title="touch命令：设置文件的时间属性"></a>touch命令：设置文件的时间属性</h6><ul>
<li>touch newfile     可以创建文件</li>
<li>touch  myfile       设置文件夹的时间为当前系统时间</li>
<li>stat   mygile       查看文本的时间属性</li>
</ul>
<h6 id="echo命令：显示文本"><a href="#echo命令：显示文本" class="headerlink" title="echo命令：显示文本"></a>echo命令：显示文本</h6><blockquote>
<p>echo命令是输出文本，shell中常用。（使用<code>;</code>间隔多条命令比如<code>echo "test1";echo "test2"</code>）</p>
</blockquote>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>echo -n</td>
<td>表示不换行输出</td>
</tr>
<tr>
<td>echo `ifconfig`</td>
<td>输出命令执行后的结果，同一行输出</td>
</tr>
<tr>
<td>echo “`ifconfig`“</td>
<td>换行输出</td>
</tr>
<tr>
<td>echo -e “test1\ttest2”</td>
<td>输出转义字符</td>
</tr>
<tr>
<td>echo -e “\033[32mTest\033[0m”</td>
<td>输出有颜色的字符串Test</td>
</tr>
</tbody></table>
<blockquote>
<p>30:黑色</p>
<p>31:红色</p>
<p>32:绿色</p>
<p>33:黄色</p>
<p>34:蓝色</p>
<p>35:紫色</p>
<p>36:浅蓝色</p>
<p>37:灰色</p>
<p>参考博客：<a target="_blank" rel="noopener" href="https://www.zsythink.net/archives/111">https://www.zsythink.net/archives/111</a></p>
</blockquote>
<h6 id="grep命令：查找字符串"><a href="#grep命令：查找字符串" class="headerlink" title="grep命令：查找字符串"></a>grep命令：查找字符串</h6><ul>
<li>查找文件中是否包含“html”字符串</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">grep 'html' file.php<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>匹配管道输出的内容，以a开头的行</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">ls -l |grep '^a'<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>


<h6 id="which命令：显示指令的绝对路径"><a href="#which命令：显示指令的绝对路径" class="headerlink" title="which命令：显示指令的绝对路径"></a>which命令：显示指令的绝对路径</h6><ul>
<li><code>which python3</code></li>
</ul>
<h6 id="帮助命令"><a href="#帮助命令" class="headerlink" title="帮助命令"></a>帮助命令</h6><table>
<thead>
<tr>
<th>help</th>
<th>main</th>
<th>info</th>
</tr>
</thead>
<tbody><tr>
<td>help |more</td>
<td></td>
<td></td>
</tr>
<tr>
<td>help -s kill</td>
<td></td>
<td></td>
</tr>
</tbody></table>
<h6 id="其他命令"><a href="#其他命令" class="headerlink" title="其他命令"></a>其他命令</h6><table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>rmdir</td>
<td>删除空目录</td>
</tr>
<tr>
<td>chgrp</td>
<td>改变文件所属的工作组</td>
</tr>
<tr>
<td>find</td>
<td>查找文件</td>
</tr>
<tr>
<td>whereis</td>
<td>显示指令及相关文件的路径</td>
</tr>
<tr>
<td>file</td>
<td>探测文件类型</td>
</tr>
<tr>
<td>locate</td>
<td>快速定位文件的路径</td>
</tr>
<tr>
<td>less</td>
<td>分屏显示文件</td>
</tr>
<tr>
<td>head</td>
<td>显示文件头部</td>
</tr>
<tr>
<td>tail</td>
<td>显示文件尾部</td>
</tr>
<tr>
<td>sort</td>
<td>按顺序显示文件类容</td>
</tr>
<tr>
<td>tree</td>
<td>树状形式显示文件(需要安装)</td>
</tr>
<tr>
<td>more</td>
<td>查看文件内容</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</tbody></table>
<h4 id="3-文本编辑器"><a href="#3-文本编辑器" class="headerlink" title="3.文本编辑器"></a>3.文本编辑器</h4><h6 id="vim命令：全屏幕纯文本编辑器"><a href="#vim命令：全屏幕纯文本编辑器" class="headerlink" title="vim命令：全屏幕纯文本编辑器"></a>vim命令：全屏幕纯文本编辑器</h6><ol>
<li>模式切换</li>
</ol>
<ul>
<li>vim 文件名：打开软件，默认是<strong>命令模式</strong></li>
<li>按insert，进入插入模式就可以编辑文本了</li>
<li>编辑好后按ESC进入底行模式，再按<code>shift加:</code>选择保存和退出</li>
</ul>
<ol start="2">
<li>保存指令</li>
</ol>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>w</td>
<td>保存</td>
</tr>
<tr>
<td>q</td>
<td>退出</td>
</tr>
<tr>
<td>wq</td>
<td>保存并且退出</td>
</tr>
<tr>
<td>q！</td>
<td>强制保存</td>
</tr>
<tr>
<td>x</td>
<td>退出，如果文件更改则保存</td>
</tr>
<tr>
<td>w test2.txt</td>
<td>可以另外保存文件</td>
</tr>
</tbody></table>
<ol start="3">
<li>查阅</li>
</ol>
<ul>
<li>h、j、k、l表示上下左右移动</li>
<li>Ctrl+f，Ctrl+b进行上下翻页</li>
</ul>
<ol start="4">
<li>其他指令</li>
</ol>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>dd</td>
<td>删除光标所在的行</td>
</tr>
<tr>
<td>dw</td>
<td>删除一个字</td>
</tr>
<tr>
<td>x</td>
<td>删除当前字符</td>
</tr>
<tr>
<td>X</td>
<td>删除前一个字符</td>
</tr>
<tr>
<td>D</td>
<td>删除光标后面的全部字符</td>
</tr>
<tr>
<td>yy</td>
<td>复制一行，前面跟数字复制多行</td>
</tr>
<tr>
<td>p</td>
<td>将粘贴版的内容粘贴到当前行的下面</td>
</tr>
<tr>
<td>P</td>
<td>将粘贴版的内容粘贴到当前行的上面</td>
</tr>
<tr>
<td>/</td>
<td>向下查找</td>
</tr>
<tr>
<td>？</td>
<td>向上查找</td>
</tr>
<tr>
<td>&gt;</td>
<td>块右移</td>
</tr>
<tr>
<td>&lt;</td>
<td>块左移</td>
</tr>
<tr>
<td>y</td>
<td>复制块</td>
</tr>
<tr>
<td>d</td>
<td>删除块</td>
</tr>
<tr>
<td>~</td>
<td>切换块中内容的大小写</td>
</tr>
</tbody></table>
<ol start="5">
<li>查找</li>
</ol>
<ul>
<li>命令模式（不确定按ESC），输入/加字符串。就可以高亮显示字符串。直接按<code>N</code>移动到下一个目标，<code>Shift+N</code>移动到上一个目标。</li>
<li>跳转到特定的行，命名模式输入：加数字，跳转到指定的行</li>
</ul>
<ol start="6">
<li>快捷键</li>
</ol>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210305101440.png"></p>
<ul>
<li>命令模式，<code>X</code>删除当前光标所在的字符。：1   删除第一行，dd删除当前所在行，<code>U</code>撤销，3dd删除三行，2dw删除多个单词，d$删除最后一行</li>
<li>i插入模式，r替换模式</li>
<li>可视模式:Shift+V（行为单位）和V（字符为单位）</li>
<li><code>Shift+,</code>和<code>Shift+.</code>文本缩进</li>
<li>复制粘贴</li>
</ul>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210305102235.png"></p>
<h6 id="nano"><a href="#nano" class="headerlink" title="nano"></a>nano</h6><ul>
<li>打开或者创建编辑文件</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">nano test.txt<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>使用^表示快捷键Ctrl，根据提示就可以了</li>
<li>快捷键的使用</li>
</ul>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210305082517.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210305082647.png"></p>
<ul>
<li>保存文件,ctl+O，回车确定文件名。如果没有修改，ctl+X退出。</li>
</ul>
<h4 id="4-文本过滤与处理"><a href="#4-文本过滤与处理" class="headerlink" title="4.文本过滤与处理"></a>4.文本过滤与处理</h4><h6 id="cat命令：链接文件并显示内容"><a href="#cat命令：链接文件并显示内容" class="headerlink" title="cat命令：链接文件并显示内容"></a>cat命令：链接文件并显示内容</h6><ul>
<li>cat经常用于文本的显示，不带参数将内容输出。</li>
</ul>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>-s</td>
<td>将文本中的空行压缩为一行显示</td>
</tr>
<tr>
<td>-n</td>
<td>显示非空行的行号</td>
</tr>
<tr>
<td>-A</td>
<td>显示所有内容</td>
</tr>
</tbody></table>
<h6 id="more命令-文本内容分屏查看器"><a href="#more命令-文本内容分屏查看器" class="headerlink" title="more命令:文本内容分屏查看器"></a>more命令:文本内容分屏查看器</h6><table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>-&lt;数字&gt;</td>
<td>每屏显示指定行数</td>
</tr>
<tr>
<td>-c</td>
<td>不进行滚屏操作</td>
</tr>
<tr>
<td>-s</td>
<td>多个空行压缩为一行显示</td>
</tr>
<tr>
<td>-u</td>
<td>禁止下划线</td>
</tr>
<tr>
<td>+&lt;数字&gt;</td>
<td>指定数字的行开始显示</td>
</tr>
</tbody></table>
<h6 id="test命令：检测文件"><a href="#test命令：检测文件" class="headerlink" title="test命令：检测文件"></a>test命令：检测文件</h6><ul>
<li>检测目录并且输出提示，也可以用？$</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">test -e /testdir &amp;&amp; echo "exit" || echo "Not exit"<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306110012.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306110030.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306110045.png"></p>
<h6 id="其他命令-1"><a href="#其他命令-1" class="headerlink" title="其他命令"></a>其他命令</h6><table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>less</td>
<td>分屏显示文件内容</td>
</tr>
<tr>
<td>grep</td>
<td>在文件中搜索匹配的行</td>
</tr>
<tr>
<td>head</td>
<td>显示文件的头部内容</td>
</tr>
<tr>
<td>tail</td>
<td>显示文件的尾部内容</td>
</tr>
</tbody></table>
<h4 id="5-压缩文件"><a href="#5-压缩文件" class="headerlink" title="5.压缩文件"></a>5.压缩文件</h4><ul>
<li>tar xf linux.tar    解压tar文件</li>
<li>tar cf  linux.tar linux/         把目录打包成linux.tar</li>
<li>unzip 解压zip文件名</li>
<li>bzip2 -d 文件名</li>
<li>bzip2 xf  linux.bz2</li>
<li>bzip2 xf  linux.tar,bz2  linux.tar将tar打包为tar.bz2文件</li>
</ul>
<h4 id="6-磁盘管理"><a href="#6-磁盘管理" class="headerlink" title="6.磁盘管理"></a>6.磁盘管理</h4><h6 id="df命令：显示报告文件磁盘使用信息"><a href="#df命令：显示报告文件磁盘使用信息" class="headerlink" title="df命令：显示报告文件磁盘使用信息"></a>df命令：显示报告文件磁盘使用信息</h6><ul>
<li>df -h或者-i：显示磁盘节点所占空间</li>
<li>df -m /home/：以MB为单位显示使用情况</li>
</ul>
<h6 id="du命令：显示目录或者文件所占的磁盘空间"><a href="#du命令：显示目录或者文件所占的磁盘空间" class="headerlink" title="du命令：显示目录或者文件所占的磁盘空间"></a>du命令：显示目录或者文件所占的磁盘空间</h6><ul>
<li>du -s /home</li>
<li>du -h：显示文件或者目录大小</li>
</ul>
<h6 id="dd命令：磁盘操作"><a href="#dd命令：磁盘操作" class="headerlink" title="dd命令：磁盘操作"></a>dd命令：磁盘操作</h6><h6 id="fdisk命令：磁盘分区"><a href="#fdisk命令：磁盘分区" class="headerlink" title="fdisk命令：磁盘分区"></a>fdisk命令：磁盘分区</h6><ul>
<li>fdisk -l：产看磁盘和分区情况</li>
<li>fdisk /dev/hhdb（设备上的磁盘）：分区和格式化</li>
</ul>
<h6 id="mount命令：挂载文件系统"><a href="#mount命令：挂载文件系统" class="headerlink" title="mount命令：挂载文件系统"></a>mount命令：挂载文件系统</h6><h6 id="umount命令：卸载文件系统"><a href="#umount命令：卸载文件系统" class="headerlink" title="umount命令：卸载文件系统"></a>umount命令：卸载文件系统</h6><h6 id="free命令：查看内存分配情况"><a href="#free命令：查看内存分配情况" class="headerlink" title="free命令：查看内存分配情况"></a>free命令：查看内存分配情况</h6><pre class="line-numbers language-none"><code class="language-none">free -m<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h6 id="fdisk命令：查看设备"><a href="#fdisk命令：查看设备" class="headerlink" title="fdisk命令：查看设备"></a>fdisk命令：查看设备</h6><ul>
<li>fdisk -l   :查看当前系统的存储设备</li>
</ul>
<h6 id="mount命令-挂载硬盘"><a href="#mount命令-挂载硬盘" class="headerlink" title="mount命令:挂载硬盘"></a>mount命令:挂载硬盘</h6><ul>
<li>mount /dev/sda1 /mnt：将设备挂载到/mnt目录下</li>
</ul>
<h6 id="umount命令：卸载硬盘"><a href="#umount命令：卸载硬盘" class="headerlink" title="umount命令：卸载硬盘"></a>umount命令：卸载硬盘</h6><ul>
<li>umount  /mnt:取消挂载，抽出硬盘需要执行这个命令</li>
</ul>
<h4 id="7-进程管理命令"><a href="#7-进程管理命令" class="headerlink" title="7.进程管理命令"></a>7.进程管理命令</h4><p>bg命令：后台运行</p>
<p>fg命令：挂起程序</p>
<p>jobs命令：显示后台程序</p>
<h6 id="kill命令：杀掉进程"><a href="#kill命令：杀掉进程" class="headerlink" title="kill命令：杀掉进程"></a>kill命令：杀掉进程</h6><ul>
<li>kill -<singal> <pid></pid></singal></li>
<li>主要信号：<ul>
<li>1：通知应用程序重新启动</li>
<li>2：通知应用程序清除自身资源并退出</li>
<li>6：通知程序终止并退出</li>
<li>9：立即终止应用运行</li>
</ul>
</li>
</ul>
<h6 id="ps命令：查看权限"><a href="#ps命令：查看权限" class="headerlink" title="ps命令：查看权限"></a>ps命令：查看权限</h6><ul>
<li>ps -ef |less （累出用户进程和后台进程）</li>
</ul>
<p>pstree命令：树状显示进程状态</p>
<h6 id="top命令：显示系统资源使用情况和进程的系统资源占用情况"><a href="#top命令：显示系统资源使用情况和进程的系统资源占用情况" class="headerlink" title="top命令：显示系统资源使用情况和进程的系统资源占用情况"></a>top命令：显示系统资源使用情况和进程的系统资源占用情况</h6><pre class="line-numbers language-none"><code class="language-none"><span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>第一行显示系统当前时间和运行多久了</li>
<li>第二行显示：进程总数、活跃、休眠、终止、僵尸进程数</li>
<li>第三行显示cpu利用率：us用户程序、sy系统程序、ni nice程序、id空闲、waIO操作的进程、hi硬件中断、si软件中断、st虚拟机管理程序“偷”走的时间</li>
<li>第四行：物理内存占用</li>
<li>第五行：虚拟内存占用</li>
<li>PID进程编号、USER进程所属用户、PR优先级、NI进程的nice值、VIRT消耗虚拟内存大小等……</li>
</ul>
<h6 id="sleep命令：暂停进程"><a href="#sleep命令：暂停进程" class="headerlink" title="sleep命令：暂停进程"></a>sleep命令：暂停进程</h6><h6 id="nohub命令：用户退出系统后继续工作"><a href="#nohub命令：用户退出系统后继续工作" class="headerlink" title="nohub命令：用户退出系统后继续工作"></a>nohub命令：用户退出系统后继续工作</h6><h4 id="8-网络管理命令"><a href="#8-网络管理命令" class="headerlink" title="8.网络管理命令"></a>8.网络管理命令</h4><h6 id="apt命令：包管理命令"><a href="#apt命令：包管理命令" class="headerlink" title="apt命令：包管理命令"></a>apt命令：包管理命令</h6><blockquote>
<p>声明一下<code>autoremove</code>和<code>upgrade</code>不能随便用</p>
</blockquote>
<ul>
<li>常用</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">apt update //更新镜像源，下载前最好更新一下
apt upgrade //更新软件，没必要就不更新
apt --purge remove  //卸载软件，包括配置文件<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>upgrade</td>
<td>更新系统中的包到最新</td>
</tr>
<tr>
<td>install  软件名</td>
<td>安装软件</td>
</tr>
<tr>
<td>–reinstall install</td>
<td>重新安装软件包</td>
</tr>
<tr>
<td>–purge remove</td>
<td>卸载然间并且清除配置文件</td>
</tr>
<tr>
<td>clean</td>
<td>清除一下载的软件包文件</td>
</tr>
</tbody></table>
<h6 id="dpkg命令：管理软件"><a href="#dpkg命令：管理软件" class="headerlink" title="dpkg命令：管理软件"></a>dpkg命令：管理软件</h6><ul>
<li>常用</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">dpkg -i 安装指定的.deb包
dpkg -l 显示已经安装的包
dpkg -P package //删除软件和配置文件<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>


<table>
<thead>
<tr>
<th></th>
<th></th>
</tr>
</thead>
<tbody><tr>
<td>-i</td>
<td>手动安装指定的软件包</td>
</tr>
<tr>
<td>-s</td>
<td>查询已安装包的工具</td>
</tr>
<tr>
<td>-L</td>
<td>查询安装包的位置</td>
</tr>
<tr>
<td>-r</td>
<td>卸载，但保留配置文件</td>
</tr>
<tr>
<td>-P</td>
<td>全部卸载</td>
</tr>
<tr>
<td>-c</td>
<td>写出的内容</td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</tbody></table>
<h6 id="ifconfig命令：显示网络接口"><a href="#ifconfig命令：显示网络接口" class="headerlink" title="ifconfig命令：显示网络接口"></a>ifconfig命令：显示网络接口</h6><ul>
<li>eth0表示以太网（ubuntu18的这个名字有些不一样）</li>
<li>lo表示本地回环</li>
<li>wlan0表示无线网卡</li>
</ul>
<h6 id="hostname命令：显示主机名"><a href="#hostname命令：显示主机名" class="headerlink" title="hostname命令：显示主机名"></a>hostname命令：显示主机名</h6><h6 id="ifup命令：激活网络设备"><a href="#ifup命令：激活网络设备" class="headerlink" title="ifup命令：激活网络设备"></a>ifup命令：激活网络设备</h6><h6 id="ifdown命令：禁止网络设备"><a href="#ifdown命令：禁止网络设备" class="headerlink" title="ifdown命令：禁止网络设备"></a>ifdown命令：禁止网络设备</h6><h6 id="route命令：设置路由表"><a href="#route命令：设置路由表" class="headerlink" title="route命令：设置路由表"></a>route命令：设置路由表</h6><h6 id="netstat命令：查看网络连接"><a href="#netstat命令：查看网络连接" class="headerlink" title="netstat命令：查看网络连接"></a>netstat命令：查看网络连接</h6><h6 id="ping命令：检测主机的连通性"><a href="#ping命令：检测主机的连通性" class="headerlink" title="ping命令：检测主机的连通性"></a>ping命令：检测主机的连通性</h6><h6 id="netreport命令：监听网络状态"><a href="#netreport命令：监听网络状态" class="headerlink" title="netreport命令：监听网络状态"></a>netreport命令：监听网络状态</h6><h6 id="ip命令：网络集成命令工具"><a href="#ip命令：网络集成命令工具" class="headerlink" title="ip命令：网络集成命令工具"></a>ip命令：网络集成命令工具</h6><h6 id="wget命令：下载文件"><a href="#wget命令：下载文件" class="headerlink" title="wget命令：下载文件"></a>wget命令：下载文件</h6><h6 id="ngrep命令：监控网络接口"><a href="#ngrep命令：监控网络接口" class="headerlink" title="ngrep命令：监控网络接口"></a>ngrep命令：监控网络接口</h6><h6 id="lsof命令：查看打开的文件"><a href="#lsof命令：查看打开的文件" class="headerlink" title="lsof命令：查看打开的文件"></a>lsof命令：查看打开的文件</h6><h6 id="nslookup命令：查看域名IP地址"><a href="#nslookup命令：查看域名IP地址" class="headerlink" title="nslookup命令：查看域名IP地址"></a>nslookup命令：查看域名IP地址</h6><pre class="line-numbers language-none"><code class="language-none">nslookup baidu.com<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h4 id="9-用户管理命令"><a href="#9-用户管理命令" class="headerlink" title="9.用户管理命令"></a>9.用户管理命令</h4><h6 id="useradd命令：增加用户"><a href="#useradd命令：增加用户" class="headerlink" title="useradd命令：增加用户"></a>useradd命令：增加用户</h6><h6 id="userdel命令：删除用户"><a href="#userdel命令：删除用户" class="headerlink" title="userdel命令：删除用户"></a>userdel命令：删除用户</h6><h6 id="usermod命令：修改已有用户信息"><a href="#usermod命令：修改已有用户信息" class="headerlink" title="usermod命令：修改已有用户信息"></a>usermod命令：修改已有用户信息</h6><h6 id="passwd命令：设置密码"><a href="#passwd命令：设置密码" class="headerlink" title="passwd命令：设置密码"></a>passwd命令：设置密码</h6><h6 id="chage命令：密码老化"><a href="#chage命令：密码老化" class="headerlink" title="chage命令：密码老化"></a>chage命令：密码老化</h6><h6 id="groupadd命令：添加用户组"><a href="#groupadd命令：添加用户组" class="headerlink" title="groupadd命令：添加用户组"></a>groupadd命令：添加用户组</h6><h6 id="groupdel命令：删除用户组"><a href="#groupdel命令：删除用户组" class="headerlink" title="groupdel命令：删除用户组"></a>groupdel命令：删除用户组</h6><h6 id="groupmod命令：修改组"><a href="#groupmod命令：修改组" class="headerlink" title="groupmod命令：修改组"></a>groupmod命令：修改组</h6><h6 id="newgrp命令：转换组"><a href="#newgrp命令：转换组" class="headerlink" title="newgrp命令：转换组"></a>newgrp命令：转换组</h6><h6 id="groups命令：显示组"><a href="#groups命令：显示组" class="headerlink" title="groups命令：显示组"></a>groups命令：显示组</h6><h6 id="who命令：显示登录用户"><a href="#who命令：显示登录用户" class="headerlink" title="who命令：显示登录用户"></a>who命令：显示登录用户</h6><h6 id="id命令：显示用户信息"><a href="#id命令：显示用户信息" class="headerlink" title="id命令：显示用户信息"></a>id命令：显示用户信息</h6><h6 id="su命令：切换命令"><a href="#su命令：切换命令" class="headerlink" title="su命令：切换命令"></a>su命令：切换命令</h6><h6 id="users命令：显示当前用户名称"><a href="#users命令：显示当前用户名称" class="headerlink" title="users命令：显示当前用户名称"></a>users命令：显示当前用户名称</h6><h4 id="10-系统管理"><a href="#10-系统管理" class="headerlink" title="10.系统管理"></a>10.系统管理</h4><h6 id="shutdown命令：设置关机"><a href="#shutdown命令：设置关机" class="headerlink" title="shutdown命令：设置关机"></a>shutdown命令：设置关机</h6><ul>
<li>20min后关机</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">shutdown  -h   20<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>关机后15：00重启</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">shutdown -r 15:00<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>


<h6 id="reboot命令：重启"><a href="#reboot命令：重启" class="headerlink" title="reboot命令：重启"></a>reboot命令：重启</h6><h6 id="corn强大系统管理命令"><a href="#corn强大系统管理命令" class="headerlink" title="corn强大系统管理命令"></a>corn强大系统管理命令</h6><ul>
<li>根据固定格式的控制文件定时自动执行命令。该控制文件称为crontab，每隔一分钟读取crontab文件，检查是否有命令要执行</li>
<li>crontab -1</li>
<li>编辑：crontab -e。会创建一个corntab文件，编辑。</li>
</ul>
<p>main命令：查看帮助信息</p>
<p>info命令：查看帮助信息</p>
<h6 id="date-命令：查看时间"><a href="#date-命令：查看时间" class="headerlink" title="date 命令：查看时间"></a>date 命令：查看时间</h6><blockquote>
<p>还可以安装ntp。好像默认安装了ntpdate，这个工具也可以进行时间校准。</p>
</blockquote>
<ul>
<li>date -s</li>
</ul>
<h2 id="三、系统使用说明"><a href="#三、系统使用说明" class="headerlink" title="三、系统使用说明"></a>三、系统使用说明</h2><h4 id="1-命令行快捷键"><a href="#1-命令行快捷键" class="headerlink" title="1.命令行快捷键"></a>1.命令行快捷键</h4><p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210307141231.png"></p>
<h4 id="2-开机说明"><a href="#2-开机说明" class="headerlink" title="2.开机说明"></a>2.开机说明</h4><ul>
<li>root用户不能远程登录。</li>
<li>debain系统安装好要自己创建root用户 <code>sudo passwd root</code>。</li>
<li>输入exit退出当前用户</li>
</ul>
<h4 id="3-安全原则"><a href="#3-安全原则" class="headerlink" title="3.安全原则"></a>3.安全原则</h4><p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210305133554.png"></p>
<h4 id="4-一些特点"><a href="#4-一些特点" class="headerlink" title="4.一些特点"></a>4.一些特点</h4><h4 id="输入输出重定向和管道"><a href="#输入输出重定向和管道" class="headerlink" title="输入输出重定向和管道"></a>输入输出重定向和管道</h4><ul>
<li>程序在默认情况下输出结果的地方称为标准输出（stdout），通常来说总是指向显示器。</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">ls &gt; /home/ubuntu/ls_out<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>这就是将ls的输出到ls_out中，如果没有这个文件会自动创建</li>
<li><code>&gt;</code>会直接覆盖原来的内容，<code>&gt;&gt;</code>会保留原来的内容在末尾添加</li>
</ul>
<p><strong>输出重定向</strong></p>
<pre class="line-numbers language-none"><code class="language-none">cat &lt; days<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>获取每一行的输入</li>
<li>另一种输出重定向被称为立即文档，<code>&lt;&lt;</code>,用户选择任意单词作为结束符号，然后一起输出</li>
</ul>
<h4 id="管道"><a href="#管道" class="headerlink" title="管道"></a>管道</h4><ul>
<li>一条明了的输出连接到另一条命令的输入</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">ls | grep ay<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>


<h4 id="其他"><a href="#其他" class="headerlink" title="其他"></a>其他</h4><h6 id="通过-proc读取信息"><a href="#通过-proc读取信息" class="headerlink" title="通过/proc读取信息"></a>通过/proc读取信息</h6><ul>
<li>cat /proc/cupinfo</li>
</ul>
<h6 id="其他-1"><a href="#其他-1" class="headerlink" title="其他"></a>其他</h6><ul>
<li>ps与grep组合查看某个进程：ps -ef|grep sshd</li>
<li>过滤自身：ps -ef|grep sshd|grep -v grep</li>
</ul>
<h6 id="用户环境"><a href="#用户环境" class="headerlink" title="用户环境"></a>用户环境</h6><ul>
<li>查看程序路径：which ssh</li>
<li>查看环境变量:echo #PATH</li>
<li>或者：env</li>
<li>添加环境变量：export VARIABLE = “SOMETHING”（不要用，重置为这一行，不是添加）</li>
<li>后面追加/opt目录：export PATH = “$PATH:/opt”</li>
</ul>
<h2 id="四、Shell编程"><a href="#四、Shell编程" class="headerlink" title="四、Shell编程"></a>四、Shell编程</h2><h4 id="1-了解"><a href="#1-了解" class="headerlink" title="1.了解"></a>1.了解</h4><h6 id="注释"><a href="#注释" class="headerlink" title="注释"></a>注释</h6><ul>
<li>注释使用<code>#</code></li>
<li>多行注释</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">:&lt;&lt;BLOCK
注释内容
BLOCK<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>


<h6 id="执行脚本的方式"><a href="#执行脚本的方式" class="headerlink" title="执行脚本的方式"></a>执行脚本的方式</h6><ul>
<li>source</li>
<li>sh script</li>
<li>./script</li>
</ul>
<h6 id="命令行补全和通配符"><a href="#命令行补全和通配符" class="headerlink" title="命令行补全和通配符"></a>命令行补全和通配符</h6><pre class="line-numbers language-none"><code class="language-none">cat fs&lt;TAB&gt;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<ul>
<li>就详单与按了一下TAB键</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">&lt;CTRL+L&gt;<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h6 id="第一行"><a href="#第一行" class="headerlink" title="第一行"></a>第一行</h6><blockquote>
<p>脚本标准起始行，包含脚本解释器的绝对路径。</p>
</blockquote>
<ul>
<li><p>终端运行python程序</p>
</li>
<li><p>python3 myprogram.py</p>
</li>
<li><p>test.py如果这样写</p>
</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">#!/usr/bin/pyhton3
print("hello")<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<ul>
<li>运行</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">chmod +x test.py
./test.py<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>


<h4 id="2-简单例子"><a href="#2-简单例子" class="headerlink" title="2.简单例子"></a>2.简单例子</h4><h6 id="输入输出与变量"><a href="#输入输出与变量" class="headerlink" title="输入输出与变量"></a>输入输出与变量</h6><pre class="line-numbers language-none"><code class="language-none">#!/bin/bash
read -p "请输入first name" firstname
read -p "请输入last name" lastname
echo -e "\n 你的名字是：${firstname} ${lastname}"<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span></span></code></pre>
<ul>
<li>简单运算</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">#!/bin/bash
read -p "请输入第一个数字：" number1
read -p "请输入第二个数字：" number2
total=$((${number1}*${number2}))
echo -e "\n 相乘结果是：${total}"<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<ul>
<li><code>total=$((${number1}*${number2}))</code>这一行代码<strong>等于号左右不能又空格</strong>，不然会报错。</li>
</ul>
<h6 id="运行和使用转义字符"><a href="#运行和使用转义字符" class="headerlink" title="运行和使用转义字符"></a>运行和使用转义字符</h6><ul>
<li>创建fizzbuzz.sh</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">#!/bin/bash
echo "\"Hello World!\""<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<ul>
<li>运行</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">chmod +x fizzbuzz.sh
./fizzbuzz.sh<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<ul>
<li>结果，控制台输出</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">"Hello World!"<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h4 id="3-变量"><a href="#3-变量" class="headerlink" title="3.变量"></a>3.变量</h4><blockquote>
<p>bash中涉及的变量不多</p>
</blockquote>
<h6 id="类型"><a href="#类型" class="headerlink" title="类型"></a>类型</h6><ul>
<li>整数</li>
<li>字符串</li>
<li>数组：标号从0开始</li>
</ul>
<h6 id="判断符号"><a href="#判断符号" class="headerlink" title="判断符号[]"></a>判断符号[]</h6><ul>
<li>判断${HOME}变量是否为空</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">[ -z "${HOME}" ];echo $?
# 输出1<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<ul>
<li>要<strong>注意空格的使用</strong>,因为中括号很多地方包括通配符和正则表达式</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">[ "$HOME" == "$MALL"]<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<blockquote>
<p>中括号内的每个组件都要用空格分隔开</p>
<p>变量和常数，最好都用双引号括起来</p>
</blockquote>
<h6 id="默认变量"><a href="#默认变量" class="headerlink" title="默认变量"></a>默认变量</h6><p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306111041.png"></p>
<h6 id="特殊字符"><a href="#特殊字符" class="headerlink" title="特殊字符"></a>特殊字符</h6><p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150112.png"></p>
<h6 id="正则表达式"><a href="#正则表达式" class="headerlink" title="正则表达式"></a>正则表达式</h6><table>
<thead>
<tr>
<th>符号</th>
<th>说明</th>
</tr>
</thead>
<tbody><tr>
<td>\</td>
<td>将下一个字符标记为特殊字符</td>
</tr>
<tr>
<td>^</td>
<td>匹配开头</td>
</tr>
<tr>
<td>$</td>
<td>匹配结尾</td>
</tr>
<tr>
<td>*</td>
<td>前面表达式任意次</td>
</tr>
<tr>
<td>+</td>
<td>前面表达式一次或者多次</td>
</tr>
<tr>
<td>？</td>
<td>零次或者一次</td>
</tr>
<tr>
<td>{n}</td>
<td>匹配确定的n次</td>
</tr>
<tr>
<td>{n，}</td>
<td>匹配至少n次</td>
</tr>
<tr>
<td>{n,m}</td>
<td>最少n次，最多m次</td>
</tr>
<tr>
<td>（）</td>
<td>对整个单元使用数量限定符</td>
</tr>
<tr>
<td>x|y</td>
<td>匹配x或者y。z|food匹配z或者food，（z|f）ood匹配zood或者food</td>
</tr>
<tr>
<td>[xyz]</td>
<td>匹配包含的任意一个字符</td>
</tr>
<tr>
<td>[^xyz]</td>
<td>匹配未包含的任意字符</td>
</tr>
<tr>
<td>[a-z]</td>
<td>匹配a到z的任意字符</td>
</tr>
<tr>
<td>\d</td>
<td>匹配一个数字字符</td>
</tr>
<tr>
<td>\D</td>
<td>匹配一个非数字字符</td>
</tr>
<tr>
<td>\n</td>
<td>匹配一个换行符</td>
</tr>
</tbody></table>
<h4 id="4-控制语句"><a href="#4-控制语句" class="headerlink" title="4.控制语句"></a>4.控制语句</h4><h6 id="if语句"><a href="#if语句" class="headerlink" title="if语句"></a>if语句</h6><ol>
<li>基本结构</li>
</ol>
<pre class="line-numbers language-none"><code class="language-none">if [&lt;判断条件&gt;]; then
		执行语句
fi<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<pre class="line-numbers language-none"><code class="language-none">if [ 条件判断式 ]; then
		执行语句
elif [ 条件判断式 ]; then
		执行语句
else 
		执行语句
fi
		<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>


<ol start="2">
<li>变量有<strong>赋值模式</strong>,直接等于<code>number=1</code>，<strong>引用模式</strong>变量前面要加上<strong>美元符</strong>号来获取变量的值。</li>
</ol>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210305132510.png"></p>
<ol start="3">
<li>进行<strong>运算测试</strong>需要$和两个括号，5%3应该写作$((5%3))</li>
</ol>
<ul>
<li>下面代码有语法错误，之后再看。</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">#!/bin/bash
number = 15
if [ $(($number%3)) -eq 0 ]; then
        echo "Fizz"
fi
if [ $(($number%5)) -eq 0 ]; then
        echo "Buff"
fi
if [ $(($number%3)) -eq 0 ]; then
        if [ $(($number%5)) -eq 0 ]; then
                echo "FizzBuzz"
        fi
fi
<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h6 id="else结构"><a href="#else结构" class="headerlink" title="else结构"></a>else结构</h6><ul>
<li>基本结构</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">if [&lt;判断条件&gt;]; then
		执行语句
else
		执行另一些语句
fi<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<h6 id="循环结构"><a href="#循环结构" class="headerlink" title="循环结构"></a>循环结构</h6><ul>
<li>基本结构，条件为真的时候执行</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">while [ TEST ];do
	循环执行的语句
done<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<h6 id="case结构"><a href="#case结构" class="headerlink" title="case结构"></a>case结构</h6><p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306120109.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210305133435.png"></p>
<h6 id="其他-2"><a href="#其他-2" class="headerlink" title="其他"></a>其他</h6><p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306120258.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306120308.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306120323.png"></p>
<h4 id="5-function功能"><a href="#5-function功能" class="headerlink" title="5.function功能"></a>5.function功能</h4><pre class="line-numbers language-none"><code class="language-none">function fname(){
		程序段
}<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306120217.png"></p>
<h4 id="6-跟踪调试"><a href="#6-跟踪调试" class="headerlink" title="6.跟踪调试"></a>6.跟踪调试</h4><p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306120337.png"></p>
<h4 id="未整理"><a href="#未整理" class="headerlink" title="未整理"></a>未整理</h4><p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150151.png"></p>
<ul>
<li>位置变量</li>
</ul>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150212.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150239.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150253.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150311.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150335.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150355.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150424.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150438.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150455.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150508.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150527.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150544.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150556.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150609.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150630.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150641.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150655.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150707.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150714.png"></p>
<p><img src="https://gitee.com/liangxinixn/blog002/raw/master/image01/20210306150750.png"></p>
<h2 id="五、其他软件服务"><a href="#五、其他软件服务" class="headerlink" title="五、其他软件服务"></a>五、其他软件服务</h2><h4 id="LAMP"><a href="#LAMP" class="headerlink" title="LAMP"></a>LAMP</h4><ul>
<li>LAMP的搭建:就是Linux系统，Apache，Mysql，PHP</li>
</ul>
<h4 id="远程桌面"><a href="#远程桌面" class="headerlink" title="远程桌面"></a>远程桌面</h4><h6 id="vnc"><a href="#vnc" class="headerlink" title="vnc"></a>vnc</h6><pre class="line-numbers language-none"><code class="language-none">apt-get install tightvncserver<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h6 id="Xrdp"><a href="#Xrdp" class="headerlink" title="Xrdp"></a>Xrdp</h6><blockquote>
<p>微软的xrdp协议</p>
</blockquote>
<pre class="line-numbers language-none"><code class="language-none">apt-get install xrdp<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h6 id="防火墙"><a href="#防火墙" class="headerlink" title="防火墙"></a>防火墙</h6><ul>
<li>图形化抓包工具Wireshark</li>
<li>强大的命令行扫描工具Nmap</li>
<li>Mateploit渗透测试软件。</li>
</ul>
<h4 id="NFS服务"><a href="#NFS服务" class="headerlink" title="NFS服务"></a>NFS服务</h4><ul>
<li>在home机器上安装</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">apt update
apt install nfs-kernel-server
vim /etc/exports

# 添加
/data/share  *(rw,sync,no_root_squash)

chmod 777 /data/share
/etc/init.d/nfs-kernel-server restart
# 我在腾讯云上面尝试成功

# 查看nfs设置
showmount -e [主机地址]
# 挂载
mount IP: 配置的目录 挂载的目录
# 卸载
umount<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span><span></span></span></code></pre>
<ul>
<li><p>启动失败</p>
</li>
<li><p>第二次尝试</p>
</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">apt install nfs-common  #这个是安装客户端吧<span aria-hidden="true" class="line-numbers-rows"><span></span></span></code></pre>
<h4 id="FTP服务"><a href="#FTP服务" class="headerlink" title="FTP服务"></a>FTP服务</h4><pre class="line-numbers language-none"><code class="language-none">apt install vsftpd
ps -e |grep ftp  # 查看是否启动<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span></span></code></pre>
<ul>
<li>安装完毕会自动创建一个<code>ftp</code>的用户，<code>/home</code>下也会新增一个文件夹，如果没有手动添加</li>
</ul>
<pre class="line-numbers language-none"><code class="language-none">useradd -m ftp
passwd ftp
chmod 777 /home/ftp<span aria-hidden="true" class="line-numbers-rows"><span></span><span></span><span></span></span></code></pre>
                
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="/about" rel="external nofollow noreferrer">lxx</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="http://xinxinliang.github.io/2021/03/15/linux-xue-xi-zong-jie/">http://xinxinliang.github.io/2021/03/15/linux-xue-xi-zong-jie/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="/about" target="_blank">lxx</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/tags/%E6%80%BB%E7%BB%93/">
                                    <span class="chip bg-color">总结</span>
                                </a>
                            
                                <a href="/tags/ubuntu/">
                                    <span class="chip bg-color">ubuntu</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">
<div id="article-share">

    
    <div class="social-share" data-sites="twitter,facebook,google,qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="https://gitee.com/liangxinixn/guitar/raw/master/image01/20200726220206.png" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="https://gitee.com/liangxinixn/guitar/raw/master/image01/20200726220308.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>

            
        </div>
    </div>

    

    

    

    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="fas fa-chevron-left"></i>&nbsp;上一篇</div>
            <div class="card">
                <a href="/2021/03/15/linux-cheng-xu-she-ji-ke-cheng-bi-ji/">
                    <div class="card-image">
                        
                        <img src="https://cdn.jsdelivr.net/gh/liangxinxin5102/image2/cartoon01/wallhaven-k97l5m.jpg" class="responsive-img" alt="Linux程序设计课程笔记">
                        
                        <span class="card-title">Linux程序设计课程笔记</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                        <span class="publish-date">
                            <i class="far fa-clock fa-fw icon-date"></i>2021-03-15
                        </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/Linux/" class="post-category">
                                    Linux
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/ubuntu/">
                        <span class="chip bg-color">ubuntu</span>
                    </a>
                    
                    <a href="/tags/%E8%AF%BE%E7%A8%8B%E7%AC%94%E8%AE%B0/">
                        <span class="chip bg-color">课程笔记</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/2021/03/04/xue-xi-ri-ji-2020.2.17-3.4/">
                    <div class="card-image">
                        
                        <img src="https://cdn.jsdelivr.net/gh/liangxinxin5102/image2/cartoon01/wallhaven-2epojx.jpg" class="responsive-img" alt="学习日记2020.2.17~3.4">
                        
                        <span class="card-title">学习日记2020.2.17~3.4</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2021-03-04
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/categories/%E6%97%A5%E8%AE%B0/" class="post-category">
                                    日记
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/tags/%E5%AD%A6%E4%B9%A0%E6%97%A5%E5%BF%97/">
                        <span class="chip bg-color">学习日志</span>
                    </a>
                    
                    <a href="/tags/%E9%9A%BE%E5%BF%98/">
                        <span class="chip bg-color">难忘</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>


<script>
    $('#articleContent').on('copy', function (e) {
        // IE8 or earlier browser is 'undefined'
        if (typeof window.getSelection === 'undefined') return;

        var selection = window.getSelection();
        // if the selection is short let's not annoy our users.
        if (('' + selection).length < Number.parseInt('120')) {
            return;
        }

        // create a div outside of the visible area and fill it with the selected text.
        var bodyElement = document.getElementsByTagName('body')[0];
        var newdiv = document.createElement('div');
        newdiv.style.position = 'absolute';
        newdiv.style.left = '-99999px';
        bodyElement.appendChild(newdiv);
        newdiv.appendChild(selection.getRangeAt(0).cloneContents());

        // we need a <pre> tag workaround.
        // otherwise the text inside "pre" loses all the line breaks!
        if (selection.getRangeAt(0).commonAncestorContainer.nodeName === 'PRE') {
            newdiv.innerHTML = "<pre>" + newdiv.innerHTML + "</pre>";
        }

        var url = document.location.href;
        newdiv.innerHTML += '<br />'
            + '来源: 头号咸鱼<br />'
            + '文章作者: lxx<br />'
            + '文章链接: <a href="' + url + '">' + url + '</a><br />'
            + '本文章著作权归作者所有，任何形式的转载都请注明出处。';

        selection.selectAllChildren(newdiv);
        window.setTimeout(function () {bodyElement.removeChild(newdiv);}, 200);
    });
</script>


<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget card" style="background-color: white;">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('0'),
            headingSelector: 'h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>




    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/libs/aplayer/APlayer.min.css">
<style>
    .aplayer .aplayer-lrc p {
        
        display: none;
        
        font-size: 12px;
        font-weight: 700;
        line-height: 16px !important;
    }

    .aplayer .aplayer-lrc p.aplayer-lrc-current {
        
        display: none;
        
        font-size: 15px;
        color: #42b983;
    }

    
    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body {
        left: -66px !important;
    }

    .aplayer.aplayer-fixed.aplayer-narrow .aplayer-body:hover {
        left: 0px !important;
    }

    
</style>
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="503838841"
                   fixed='true'
                   autoplay='false'
                   theme='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.7'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/libs/aplayer/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

    
    <div class="container row center-align" style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            
                <span id="year">2021</span>
            
            <span id="year">2021</span>
            <a href="/about" target="_blank">lxx</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                class="white-color">272.8k</span>&nbsp;字
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/xinxinliang" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:1974733812@qq.com" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=1974733812" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 1974733812" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script type="text/javascript">
$(function () {
    var searchFunc = function (path, search_id, content_id) {
        'use strict';
        $.ajax({
            url: path,
            dataType: "xml",
            success: function (xmlResponse) {
                // get the contents from search data
                var datas = $("entry", xmlResponse).map(function () {
                    return {
                        title: $("title", this).text(),
                        content: $("content", this).text(),
                        url: $("url", this).text()
                    };
                }).get();
                var $input = document.getElementById(search_id);
                var $resultContent = document.getElementById(content_id);
                $input.addEventListener('input', function () {
                    var str = '<ul class=\"search-result-list\">';
                    var keywords = this.value.trim().toLowerCase().split(/[\s\-]+/);
                    $resultContent.innerHTML = "";
                    if (this.value.trim().length <= 0) {
                        return;
                    }
                    // perform local searching
                    datas.forEach(function (data) {
                        var isMatch = true;
                        var data_title = data.title.trim().toLowerCase();
                        var data_content = data.content.trim().replace(/<[^>]+>/g, "").toLowerCase();
                        var data_url = data.url;
                        data_url = data_url.indexOf('/') === 0 ? data.url : '/' + data_url;
                        var index_title = -1;
                        var index_content = -1;
                        var first_occur = -1;
                        // only match artiles with not empty titles and contents
                        if (data_title !== '' && data_content !== '') {
                            keywords.forEach(function (keyword, i) {
                                index_title = data_title.indexOf(keyword);
                                index_content = data_content.indexOf(keyword);
                                if (index_title < 0 && index_content < 0) {
                                    isMatch = false;
                                } else {
                                    if (index_content < 0) {
                                        index_content = 0;
                                    }
                                    if (i === 0) {
                                        first_occur = index_content;
                                    }
                                }
                            });
                        }
                        // show search results
                        if (isMatch) {
                            str += "<li><a href='" + data_url + "' class='search-result-title'>" + data_title + "</a>";
                            var content = data.content.trim().replace(/<[^>]+>/g, "");
                            if (first_occur >= 0) {
                                // cut out 100 characters
                                var start = first_occur - 20;
                                var end = first_occur + 80;
                                if (start < 0) {
                                    start = 0;
                                }
                                if (start === 0) {
                                    end = 100;
                                }
                                if (end > content.length) {
                                    end = content.length;
                                }
                                var match_content = content.substr(start, end);
                                // highlight all keywords
                                keywords.forEach(function (keyword) {
                                    var regS = new RegExp(keyword, "gi");
                                    match_content = match_content.replace(regS, "<em class=\"search-keyword\">" + keyword + "</em>");
                                });

                                str += "<p class=\"search-result\">" + match_content + "...</p>"
                            }
                            str += "</li>";
                        }
                    });
                    str += "</ul>";
                    $resultContent.innerHTML = str;
                });
            }
        });
    };

    searchFunc('/search.xml', 'searchInput', 'searchResult');
});
</script>

    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    
    <script>
        (function (i, s, o, g, r, a, m) {
            i["DaoVoiceObject"] = r;
            i[r] = i[r] || function () {
                (i[r].q = i[r].q || []).push(arguments)
            }, i[r].l = 1 * new Date();
            a = s.createElement(o), m = s.getElementsByTagName(o)[0];
            a.async = 1;
            a.src = g;
            a.charset = "utf-8";
            m.parentNode.insertBefore(a, m)
        })(window, document, "script", ('https:' == document.location.protocol ? 'https:' : 'http:') +
            "//widget.daovoice.io/widget/6984b559.js", "daovoice")
        daovoice('init', {
            app_id: "7b318e23"
        });
        daovoice('update');
    </script>
    

    <!--腾讯兔小巢-->
    
    

    

    

    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
